Item Property (Messages Collection)
The Item
property returns a single Message
Syntax
objMsgColl.Item(index)
objMsgColl.Item(prefix)
index
A long
integer ranging from 1 to the size of the Messages collection.
prefix
A string
representing a prefix substring of a Message object s Subject
Data Type
Object
Remarks
The Item
property is useful for satisfying syntax requirements when obtaining a member
of a Messages collection.
A large
collection cannot support true integer indexing, and the Item(index)
syntax cannot be used for arbitrary selection of members of the collection.
Programmers needing to access individual objects in a large collection are
strongly advised to use the Visual Basic For Each statement or the Get
methods, particularly GetFirst
The Item(index)
syntax is provided solely as a placeholder in an indexed loop, such as the For
... Next construction in Visual Basic. Such a loop must proceed forward
from the beginning of the collection, and the index must have initial and
increment values of 1. Results are undefined for any other procedure.
For more
information on using the Count and Item properties in a large
collection, see the example in the Count
The Item(prefix)
syntax returns the first Message object whose Subject
The Item
property is the default property of a Messages collection, meaning that
Messages(index) is syntactically equivalent to Messages.Item(index)
in Visual Basic code.